#pragma once
#include "simple_string.h"

class SimpleStringOwner {
  SimpleString str_;

public:
  SimpleStringOwner(const char *s) : str_{10} {
    if (!str_.appendLine(s)) {
      throw std::runtime_error("Not enough memory!");
    }
    str_.print("Constructed: ");
  }
  SimpleStringOwner(const SimpleString &ss) : str_{ss} {}
  SimpleStringOwner(SimpleString &&ss) : str_{std::move(ss)} {}
  ~SimpleStringOwner() { str_.print("Destructed: "); }
};
